package
{
    import com.brandonflowers.states.Main;
    
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.*;
    
    import org.hive.Hive;
  	
    [SWF(backgroundColor=0xffffff, frameRate=30, width=900, height=680)]
    public class HIVE_UNION extends Sprite
    {
       	private var _hive:Hive;
    	private var _unionChat:UnionChat;
    	
              
        public function HIVE_UNION()
        {
            super();
            
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP; //TODO: make stageLeft and other props relative to stage.align value.
            
            initHive();
            initUnion();
        }
        
        private function initHive():void
        {
            _hive = new Hive(this);
            
             var _main:Main = new Main(); 
            _main.addEventListener("ALL_LOADED", addUnion);
            
            _hive.start( _main);
        }
        
        private function initUnion():void
        {
        	_unionChat = new UnionChat();
        }
        
        private function addUnion(e:Event)
        {
        	addChild( _unionChat );
        }
        
    }
}
